package tech.aistar.day12;

import java.util.Scanner;

/**
 * 本类用来演示:
 *
 * @author: success
 * @date: 2021/3/23 9:49 上午
 */
public class RegexDemo {
    public static void main(String[] args) {
        String ip = "the23232javafdfdpython3232jav@the";
       // String[] arr = ip.split("\\s");//匹配任意空白字符
        String[] arr = ip.split("[^a-z]");//匹配任意空白字符
        for (String s : arr) {
            //System.out.println(s);
            if(s.trim().length()!=0){
                System.out.println(s);
            }
        }


        Scanner sc = new Scanner(System.in);
        System.out.print(">");
        String str = sc.nextLine();

        //if(str.matches("[0-9]")){
        //if(str.matches("[0-9]?")){
        //if(str.matches("\\d+")){

        //用户验证
        //首字母必须是小写,其余由数字,字母,_组成,4-6个
        //if(str.matches("[a-z][0-9A-Za-z_@]{3,5}")){

        //手机号匹配规则
        //开头-> 13   15  17  18
        //总共是11个

        //if(str.matches("[a-z]\\w{3,5}")){
        if(str.matches("1[3|5|7|8]\\d{9}")){
            System.out.println("匹配");
        }else{
            System.out.println("不匹配");
        }


    }
}
